package org.example;

import org.example.pack7.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test06 {

    @Test
    public void testComponet(){

        String config = "applicationContext.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        //从classpath读配置文件 从文件中读到那个组件扫描器中的包
        //递归扫描所有包中的子类找那个包 找到之后根据你的注解生成对应类的对象
        

        Student student = (Student)ac.getBean("student");
        System.out.println(student);
    }
}
